package com.google.code.sip.ucenter.ws.dto;

import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlElementRefs;
import javax.xml.bind.annotation.XmlMixed;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement(name = "page")
@XmlAccessorType(XmlAccessType.NONE)
public class PageDto<T> {
	@XmlElement
	protected int pageNo = -1;
	@XmlElement
	protected int pageSize = -1;
	@XmlMixed
	@XmlElementRefs( {
			@XmlElementRef(name = "user", type = UserDto.class),
			@XmlElementRef(name = "userProfile", type = UserProfileDto.class),
			@XmlElementRef(name = "userCustomProfile", type = UserCustomProfileDto.class),
			@XmlElementRef(name = "userEvent", type = UserEventDto.class),
			@XmlElementRef(name = "application", type = ApplicationDto.class),
			@XmlElementRef(name = "credit", type = CreditDto.class),
			@XmlElementRef(name = "creditType", type = CreditTypeDto.class),
			@XmlElementRef(name = "creditRule", type = CreditRuleDto.class),
			@XmlElementRef(name = "creditRuleLog", type = CreditRuleLogDto.class),
			@XmlElementRef(name = "creditLog", type = CreditLogDto.class),
			@XmlElementRef(name = "friend", type = FriendDto.class),
			@XmlElementRef(name = "friendGroup", type = FriendGroupDto.class),
			@XmlElementRef(name = "huoshowAccount", type = HuoshowAccountDto.class),
			@XmlElementRef(name = "huoshowAccountLog", type = HuoshowAccountLogDto.class),
			@XmlElementRef(name = "notification", type = NotificationDto.class),
			@XmlElementRef(name = "setting", type = SettingDto.class) })
	private List<T> result = new ArrayList<T>(0);
	@XmlElement
	private long totalCount = 0;

	public int getPageNo() {
		return pageNo;
	}

	public void setPageNo(int pageNo) {
		this.pageNo = pageNo;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public List<T> getResult() {
		return result;
	}

	public void setResult(List<T> result) {
		this.result = result;
	}

	public long getTotalCount() {
		return totalCount;
	}

	public void setTotalCount(long totalCount) {
		this.totalCount = totalCount;
	}
}
